Add store delete command#8035
Conversation
|
This has been NEEDED! |
c4ddb40 to
274afea
Compare
274afea to
f110d2c
Compare
|
/snapit |
1 similar comment
|
/snapit |
437d91f to
11125b5
Compare
isaacroldan
left a comment
There was a problem hiding this comment.
Review assisted by pair-review
56031ae to
638480a
Compare
890d637 to
be5255b
Compare
be5255b to
af8142a
Compare
Assisted-By: devx/921acb10-d127-42c8-8a9a-0314a325d188
af8142a to
d27e901
Compare
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260724115655Caution After installing, validate the version by running |
gonzaloriestra
left a comment
There was a problem hiding this comment.
I guess it's a backend issue, but the confirmation timed out:
❯ shopify store delete --store dev-store-cli.myshopify.com
╭─ warning ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Development store "dev-store-cli.myshopify.com" deletion was requested, but not confirmed. │
│ │
│ Shopify accepted the deletion request, but deletion was not confirmed before the CLI stopped waiting. The store may still finish deleting │
│ asynchronously. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
I got an email about the store being closed and when I open admin it says You can’t access this store because it’s frozen. However, it's still listed in Dev Dashboard. I'll check later if it's still there.
| static flags = { | ||
| ...globalFlags, | ||
| ...jsonFlag, | ||
| store: storeFlags.store, |
There was a problem hiding this comment.
I see this flag is required, but I think we could prompt when the flag is missing. The issue is common to all the store commands, so no need to fix it now, but I think we should improve it.
|
|
||
| async run(): Promise<void> { | ||
| const {flags} = await this.parse(StoreDelete) | ||
| this.failMissingNonTTYFlags(flags, ['store']) |
There was a problem hiding this comment.
The flag is required, so this is not needed, no?
| const {flags} = await this.parse(StoreDelete) | ||
| this.failMissingNonTTYFlags(flags, ['store']) | ||
|
|
||
| const organization = await organizationForStoreDeletion(flags.store, flags['organization-id']?.toString()) |
There was a problem hiding this comment.
If there's an error here, it will show a regular abort when the --json flag is provided. Not a big deal because we are not handling as expected yet json errors everywhere. But I think we could solve it by moving it inside the try-catch.

WHY are these changes introduced?
Fixes https://github.com/shop/issues-develop/issues/22936
Shopify CLI needs a CLI-side
shopify store deletecommand for app development stores. Business Platform now accepts app development store deletion requests by calling CorebillingCloseShop(immediate: true), but Core cancellation completes asynchronously and BP no longer eagerly removes the BP Shop row. Because mutation success means “close request accepted”, the CLI must wait for the authoritative cancellation signal from Organizations API instead of treating row disappearance as success.WHAT is this pull request doing?
shopify store deletecommand in@shopify/storefor deleting development stores.--json,--store, and--organization-id.deleteAppDevelopmentStoreBusiness Platform mutation document and typed document.shopifyShopIdusing the existing Organizations API accessible shops lookup before polling.organization.accessibleShop(id:)untilplanNameis exactlycancelled.accessibleShopresponse as inconclusive rather than confirmed cancellation.accessibleShoppolling responses.How to test your changes?
Tophat:
Enable the backend store-create/delete CLI flag (
f_cli_store_create_enabled) for your organization.From this branch, create a new development store through the local CLI:
Confirm the store appears in Dev Dashboard:
https://dev.shopify.com/dashboard/<organization-id>/stores.From this branch, run the new delete command through the local CLI:
Confirm the command reports the deletion request/confirmation and that the development store is no longer active in Dev Dashboard.
Automated checks:
pnpm --filter @shopify/store vitest run src/cli/commands/store/delete.test.ts src/cli/services/store/delete/dev.test.ts src/cli/utilities/store-lookup/organization-shop.test.tspnpm --filter @shopify/store lintpnpm --filter @shopify/store type-checkPost-release steps
None.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add